package come.bjpowernode.javase.automic;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerTest1 {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(10);
        System.out.println(atomicInteger.get());
        System.out.println(atomicInteger.incrementAndGet());
        System.out.println(atomicInteger.compareAndSet(11,20));
        System.out.println(atomicInteger.get());
        int i = 10;
        System.out.println(atomicInteger.addAndGet(-i));
        
    }
}
